package language.advanced;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;

public class fileReadTest {
    public static void main(String[] args) throws IOException {

        System.setProperty("proxyType", "4");
        System.setProperty("proxyPort", "3721");
        System.setProperty("proxyHost", "172.30.251.92");
        System.setProperty("proxySet", "true");

        BufferedInputStream bis = null;
        HttpURLConnection urlconnection = null;

        URL url = new URL("https://www.sogou.com/");
        urlconnection = (HttpURLConnection) url.openConnection();
        urlconnection.connect();
        bis = new BufferedInputStream(urlconnection.getInputStream());
        System.out.println("file type:"+HttpURLConnection.guessContentTypeFromStream(bis));
    }
}
